﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OpenPhotoAlbum.BusinessLogics;

namespace OpenPhotoAlbum.Maintainance
{
	public partial class Services : AlbumPage
	{
		protected override void AppendSiteMapNodes(OpenPhotoAlbum.Controls.AlbumSiteMapProvider provider)
		{
			base.AppendSiteMapNodes(provider);

			provider.AppendSiteMapNode("Maintainance Console", "~/Maintainance/Default.aspx");
			provider.AppendSiteMapNode("Restricted Services", RawUrl);
		}

		protected void btnSubmit_Click(object sender, EventArgs e)
		{
			string ip = tbIpAddress.Text.Trim();

			if (string.IsNullOrEmpty(ip)) { return; }

			ServiceManager.Instance.AddIpAddress(ip);

			gridView.DataBind();
		}
	}
}
